package org.september.pisces.user.permission.entity;

import java.util.Date;

import org.september.smartdao.anno.AutoIncrease;
import org.september.smartdao.anno.Entity;
import org.september.smartdao.anno.Id;
import org.springframework.format.annotation.DateTimeFormat;

import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.DefaultValue;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;

import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 *
 **/
@Data
@Entity
@Table("pisces_system_role")
public class SystemRole {

    /**
     *
     */
    @Id
    @AutoIncrease
    @IsKey
    @IsAutoIncrement
    @Column(name = "id", length = 20)
    private Long id;

    /**
     * 角色名称
     */
    @Size(max = 32)
    @Column(name = "name", comment = "角色名称", length = 32)
    private String name;

    /**
    *用户id
    */
   @Column(name = "uid", length = 20)
   protected Long uid;

    /**
     * 备注
     */
    @Size(max = 128)
    @Column(name = "remark", length = 128)
    private String remark;

    /**
     * 是否内置角色，1：是，0：否
     */
    @Column(name = "is_build_in", type = MySqlTypeConstant.SMALLINT, length = 6, comment = "是否内置角色，1：是，0：否")
    private Integer isBuildIn;
    
    /**
     * 角色编码，只有内置角色有
     */
    @Column(name = "code", length = 32, comment = "角色编码，只有内置角色有")
    private String code;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "function")
    private String function;
    
    /**
    *
    */
   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
   @Column(name = "addtime", type = MySqlTypeConstant.DATETIME)
   protected Date addtime;

   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
   @Column(name = "update_time", type = MySqlTypeConstant.DATETIME)
   protected Date updateTime;

   /**
    *
    */
   @Column(name = "adduid", length = 20)
   protected Long adduid;

   /**
    *
    */
   @Column(name = "delete_flag", type = MySqlTypeConstant.SMALLINT, length = 6, isNull = false)
   @DefaultValue("0")
   protected Integer deleteFlag;

   /**
    *
    */
   @Column(name = "delete_uid", length = 20)
   protected Long deleteUid;

   /**
    *
    */
   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
   @Column(name = "delete_time", type = MySqlTypeConstant.DATETIME)
   protected Date deleteTime;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getIsBuildIn() {
        return isBuildIn;
    }

    public void setIsBuildIn(Integer isBuildIn) {
        this.isBuildIn = isBuildIn;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getFunction() {
        return function;
    }

    public void setFunction(String function) {
        this.function = function;
    }
}
